
const app =getApp()

Component({
    /**
     * 组件的属性列表
     */
    properties: {
      
    },
    ready :function(){
       
    },
    /**
     * 组件的初始数据
     */
    data: {
      xArticle:[]
    },
    
    /**
     * 组件的方法列表
     */
    methods: {
        // 前往文章详情
      xToArticleDetail: function (e) {
        let id = e.currentTarget.dataset.id
        wx.navigateTo({
            url: '/subtool/pages/article/detail/index?id=' + id,
        })
      },
       xArticle:function(){
        let that =this;
         wx.cloud.callFunction({
          name: 'article',
          data: {
              action: "get_article_list",
              dataObj: {
                page_num: 1,
                limit_num: 10,
                recommended_home_page:true //主页推荐文章 
              }
          }
        }).then(res => {
          that.setData({
              xArticle : res.result
          })
        })
       }
        
    },
    // created:function(){
    //    this.xGetProduct()
    //   //  this.GetUserInfo()
    // },
    attached:function(){
      this.xArticle()
    }
})
